import React from 'react';
import Formuser from './form_user';
import { Form } from 'antd';
import { connect } from 'dva';

export default connect(({ pay, order }: any) => ({
  auth: pay.view,
  personData: order.personData,
  commodityData: order.commodityData,
  utilsData: order.utilsData,
}))(
  Form.create({
    mapPropsToFields(props: any) {
      return {
        unit: Form.createFormField({
          value: props.utilsData.length > 0 ? props.utilsData[0].value : '',
        }),
        proofPhotoUrl: Form.createFormField({
          value: '',
        }),
      };
    },
  })(Formuser),
);
